;Understand, Correct, Improve           ___
;________/| _________________/\__/\____/  /_____
;\  ____/ |/   __/  /  / __ /  \/  \  \  /   __/
;|   __/  /\__   \    /  __ \      /     \  _/ \
;|___\ \__\____  //__/\_____/\    /__/\  /_____/
;+-------------\/breeze'03----\  /crew-\/------+
;                              \/
; Fishb0ne borntro 2008 [Pentagon 1024SL 2.2]
; Copyright (C) 2008 Fishbone CREW All right reserved
; Written by breeze \ fishbone crew | http://twilight.org.ru
; breeze@tut.by
; 29.01.2008

; Draw Horizontal line

	; ld 	bc,#0000		; yyxx
	; ld 	de,#0001		; len
	;          IiGRBgrb
	; ld	a,%00000000		; color

drawHline8x	push	af
		call	xyToScr

		ld	a,h
		push	af
		or	#c0
		ld	h,a
		ld	(hAddr1+1),hl

		pop	af
		push	af
		or	#40
		ld	h,a
		ld	(hAddr2+1),hl

		pop	af
		push	af
		or	#e0
		ld	h,a
		ld	(hAddr3+1),hl

		pop	af
		or	#60
		ld	h,a
		ld	(hAddr4+1),hl
		
		push	de
		pop	bc

		

		dec	bc
		ld	a,b
		or	c
		jr	nz,drawHline_1
		pop	af
		ld	hl,(hAddr1+1)
		ld	(hl),a
		ld	hl,(hAddr2+1)
		ld	(hl),a
		ld	hl,(hAddr3+1)
		ld	(hl),a
		ld	hl,(hAddr4+1)
		ld	(hl),a
		ret


drawHline_1	pop	af

		push	bc
hAddr1		ld	hl,#c000
		ld	(hl),a
		push	hl
		pop	de
		inc	de
		ldir
		pop	bc

		push	bc
hAddr2		ld	hl,#4000
		ld	(hl),a
		push	hl
		pop	de
		inc	de
		ldir
		pop	bc

		push	bc
hAddr3		ld	hl,#e000
		ld	(hl),a
		push	hl
		pop	de
		inc	de
		ldir
		pop	bc

		push	bc
hAddr4		ld	hl,#6000
		ld	(hl),a
		push	hl
		pop	de
		inc	de
		ldir
		pop	bc
			
		ret	